import Vue from 'vue'
import VueRouter from 'vue-router'
const Initial = () => import('../components/Initial.vue')
const Login = () => import('../components/Login.vue')
const Login_phone = () => import('../components/Login_phone.vue')
const Home = () => import('../components/Home.vue')
const LoginFirst = () => import('../components/LoginFirst.vue')
const Address = () => import('../components/Address.vue')
const Search_address = () => import('../components/Search_address.vue')
const Store = () => import('../components/Store.vue')
const Mall = () => import('../components/Mall.vue')
const Detail = () => import('../components/Detail.vue')
const Service = () => import('../components/Service.vue')
const Order = () => import('../components/Order.vue')
const Mine = () => import('../components/Mine.vue')
const Mine_pet = () => import('../components/Mine_pet.vue')
const Setting = () => import('../components/Setting.vue')
const Forget_password = () => import('../components/Forget_password.vue')
const Dog = () => import('../components/Dog.vue')
const Cat = () => import('../components/Cat.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/Initial',
    name: 'Initial',
    component: Initial,
  },
  {
    path: '/Login',
    name: 'Login',
    component: Login,
    redirect: '/loginfirst',

    children: [
      {
        path: '/Login_phone',
        name: 'Login_phone',
        component: Login_phone,
      },
      { path: '/loginfirst', component: LoginFirst, name: 'loginfirst' },
    ],
  },
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
  {
    path: '/Address',
    name: 'Address',
    component: Address,
  },
  {
    path: '/Search_address',
    name: 'Search_address',
    component: Search_address,
  },
  {
    path: '/Store',
    name: 'Store',
    component: Store,
  },
  {
    path: '/Mall',
    name: 'Mall',
    component: Mall,
    children: [
      {
        path: '/Dog',
        name: 'Dog',
        component: Dog,
      },
      {
        path: '/Cat',
        name: 'Cat',
        component: Cat,
      },
    ],
  },
  {
    path: '/Detail',
    name: 'Detail',
    component: Detail,
  },
  {
    path: '/Service',
    name: 'Service',
    component: Service,
  },
  {
    path: '/Order',
    name: 'Order',
    component: Order,
  },
  {
    path: '/Mine',
    name: 'Mine',
    component: Mine,
  },
  {
    path: '/Mine_pet',
    name: 'Mine_pet',
    component: Mine_pet,
  },
  {
    path: '/Setting',
    name: 'Setting',
    component: Setting,
  },
  {
    path: '/Forget_password',
    name: 'Forget_password',
    component: Forget_password,
  },
]

const router = new VueRouter({
  routes,
})

export default router
